package com.itlong.cloud.POJO.PO;

import com.itlong.cloud.annotation.ItlField;
import com.itlong.cloud.annotation.ItlTables;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <desc>
 *      用户云对讲设备权限实体类
 * </desc>
 *
 * @createDate 2017/09/30
 */
@ItlTables("device_cloud_intercom_auth")
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class DeviceCloudIntercomAuthPO extends BasePO implements Serializable{
    @ItlField("user_id")
    private String userId;     //被授权人ID，即用户唯一ID

    @ItlField("project_id")
    private String projectId;       //项目编号，由8位数字构成,00000001~99999999

    @ItlField("user_type")
    private String userType;

    @ItlField("vali_time")
    private Date valiTime;      //有效时间，精确到日

    @ItlField("device_auth")
    private String deviceAuth;      //授权设备信息,Hex字符串,如1B..00,转换为二进制为:00011011,代表有第4,5,7号云对讲控制器权限

    @ItlField("dynamic_pwd")
    private String dynamicPwd;     //动态密码,HEX字符串，代表有权限的云对讲的动态密码，每部云对讲仅有一个动态密码，
                                        // 使用6个HEX码表示（如123456或FF1234）

    @ItlField("static_pwd")
    private String staticPwd;       //静态密码,HEX字符串，代表有权限的云对讲的静态密码，每部云对讲仅有一个静态密码，
                                        // 使用6个HEX码表示（如123456或FF1234）

    @ItlField("auth_source")
    private Integer authSource;     //设备权限来源标识(1:一卡通 2:物业后台)

    @ItlField("auth_user_id")
    private String authUserId;      //授权人ID，可能为用户id也可能为物业账号id

    @ItlField("orders")
    private String orders; //排序号,代表所有有权限的云对讲设备的排序号（00030001表示3号云对讲排序1）,多个以英文逗号分隔

    public DeviceCloudIntercomAuthPO(String userId, String projectId, String userType, Date valiTime, String deviceAuth,
                                     String dynamicPwd, String staticPwd, Integer authSource, String authUserId) {
        this.userId = userId;
        this.projectId = projectId;
        this.userType = userType;
        this.valiTime = valiTime;
        this.deviceAuth = deviceAuth;
        this.dynamicPwd = dynamicPwd;
        this.staticPwd = staticPwd;
        this.authSource = authSource;
        this.authUserId = authUserId;
    }
}
